// Copyright Epic Games, Inc. All Rights Reserved.

#pragma once

//#include "Settings/LyraMobilePerformance.h"
#include "GameSettingValueDiscrete.h"

#include "LyraSettingValueDiscrete_MobileFPSType.generated.h"

enum class EGameSettingChangeReason : uint8;

class UObject;

/**
 * 移动设备FPS类型离散值设置类，继承自UGameSettingValueDiscrete
 */
UCLASS()
class ULyraSettingValueDiscrete_MobileFPSType : public UGameSettingValueDiscrete
{
	GENERATED_BODY()
	
public:

	ULyraSettingValueDiscrete_MobileFPSType();

	//~UGameSettingValue接口
	/**
	 * 存储初始设置
	 */
	virtual void StoreInitial() override;
	/**
	 * 重置为默认值
	 */
	virtual void ResetToDefault() override;
	/**
	 * 恢复到初始值
	 */
	virtual void RestoreToInitial() override;
	//~UGameSettingValue接口结束

	//~UGameSettingValueDiscrete接口
	/**
	 * 根据索引设置离散选项
	 */
	virtual void SetDiscreteOptionByIndex(int32 Index) override;
	/**
	 * 获取离散选项索引
	 */
	virtual int32 GetDiscreteOptionIndex() const override;
	/**
	 * 获取离散选项
	 */
	virtual TArray<FText> GetDiscreteOptions() const override;
	//~UGameSettingValueDiscrete接口结束

protected:
	/** UFortSettingValue */
	/**
	 * 初始化时调用
	 */
	virtual void OnInitialized() override;

	/**
	 * 获取值
	 */
	int32 GetValue() const;
	/**
	 * 设置值
	 */
	void SetValue(int32 NewLimitFPS, EGameSettingChangeReason InReason);

	/**
	 * 获取默认FPS
	 */
	int32 GetDefaultFPS() const;

	/**
	 * 创建限制字符串
	 */
	static FText MakeLimitString(int32 Number);

protected:
	int32 InitialValue; // 初始值
	TSortedMap<int32, FText> FPSOptions; // FPS选项排序映射
};